import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'app_colors.dart';

class AppStyleThemeData {
  static ThemeData CustomThemeLight = ThemeData(
    primaryColor: AppColors.app_base_bgcolor_color,
    scaffoldBackgroundColor: AppColors.device_page_bg_color,
    // 可以覆盖更多的ThemeData属性来自定义你的主题
    appBarTheme: AppBarTheme(
        titleTextStyle: TextStyle(color: AppColors.hex1E1E1E,
            fontSize: 36.sp),
        backgroundColor: AppColors.device_page_bg_color
    ),
    bottomNavigationBarTheme: BottomNavigationBarThemeData(
        backgroundColor:Colors.white,
        selectedItemColor:AppColors.bottomTabActiveColor,
        unselectedItemColor: AppColors.bottomTabUnActiveColor,
        selectedIconTheme: IconThemeData(
            size: 50
        ),
        unselectedIconTheme: IconThemeData(
            size: 50
        ),
        selectedLabelStyle:  TextStyle(fontSize: 18.sp),
        unselectedLabelStyle: TextStyle(fontSize: 18.sp)

    ),
    // 文本框的样式.
    inputDecorationTheme: InputDecorationTheme(
      border: InputBorder.none,
      focusedBorder: OutlineInputBorder (
          borderRadius: BorderRadius.circular(45.0),
          borderSide:BorderSide(color: Colors.blue)
      ),
     /* border: OutlineInputBorder (
          borderRadius: BorderRadius.circular(15.0),
          borderSide:BorderSide(color: AppColors.editFieldborder_color)
      ),
      focusedBorder: OutlineInputBorder (
          borderRadius: BorderRadius.circular(15.0),
          borderSide:BorderSide(color: AppColors.editFieldborder_color)
      ),
      enabledBorder: OutlineInputBorder (
          borderRadius: BorderRadius.circular(15.0),
          borderSide:BorderSide(color: AppColors.editFieldborder_color)
      ),*/
      hintStyle: TextStyle(color: AppColors.newEditFieldHintText_color,fontSize: 30.sp,),
      helperStyle: TextStyle(color: AppColors.editFieldText_color,fontSize: 30.sp),
      labelStyle: TextStyle(color: AppColors.editFieldText_color,fontSize: 30.sp),
      contentPadding: EdgeInsets.only(left: 41.w,top:24.h,bottom:24.h, right: 30.w),
    ),
    //
    elevatedButtonTheme: ElevatedButtonThemeData(
        style: ButtonStyle(
               backgroundColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
              if (states.contains(WidgetState.pressed)) {
                return AppColors.appElevateBtnBgColor.withOpacity(0.7); // 按下时的背景色
              } else if (states.contains(WidgetState.disabled)) {
                return AppColors.appElevateBtnBgColor.withOpacity(0.2);
              } else {
                return AppColors.appElevateBtnBgColor; // 默认背景色
              }

            }),
            foregroundColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
              if (states.contains(WidgetState.disabled)) {
                return Colors.white;
              }
              return Colors.white;
            }),
            shape: WidgetStateProperty.all<OutlinedBorder>(
              RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(90.0), // 圆角大小
              ),
            ),
            padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
              EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), // 内边距
            ),
            overlayColor: WidgetStateProperty.resolveWith<Color?>(
                  (Set<WidgetState> states) {
                if (states.contains(WidgetState.hovered)) {
                  return Colors.green.withOpacity(0.1); // 悬停时的叠加色
                }
                return null; // 默认无叠加色
              },
            ),
            textStyle: WidgetStateProperty.resolveWith<TextStyle>(
                  (Set<WidgetState> states) {
                return TextStyle(fontSize: 28.sp,fontWeight: FontWeight.bold);
              },
            )
        )
    ),
    primaryTextTheme: TextTheme(
        titleMedium: TextStyle(fontWeight: FontWeight.w400,fontSize: 40.sp)
    ),
    textTheme: TextTheme(
      titleMedium: TextStyle(fontWeight: FontWeight.w400,fontSize: 40.sp),
      titleSmall: TextStyle(fontWeight: FontWeight.w400,fontSize: 28.sp),
      labelMedium: TextStyle(fontSize: 30.sp,color: AppColors.app_base_bgcolor_color),
      labelSmall: TextStyle( color: AppColors.labelText_color,fontSize: 24.sp),
    ),
    dialogTheme: DialogTheme(
        titleTextStyle:  TextStyle(fontSize: 34.sp,color: AppColors.dialogTextColor,fontWeight: FontWeight.bold),
        contentTextStyle: TextStyle(fontSize: 28.sp,color: AppColors.dialogTextColor)

    ),

  );


  static ThemeData CustomThemeDark = ThemeData(
    primaryColor: AppColors.app_base_bgcolor_color,
    scaffoldBackgroundColor: AppColors.word_page_bgcolor,
    // 可以覆盖更多的ThemeData属性来自定义你的主题
    /*appBarTheme: AppBarTheme(
          titleTextStyle: TextStyle(color: AppColors.hex1E1E1E,fontWeight: FontWeight.w700,
              fontSize: 40.sp)
      ),
      bottomNavigationBarTheme: BottomNavigationBarThemeData(
          backgroundColor:Colors.white,
          selectedItemColor:Colors.white,
          unselectedItemColor: Colors.white,
          selectedIconTheme: IconThemeData(
              size: 20,
              color: Colors.blue
          ),
          unselectedIconTheme: IconThemeData(
              size: 10,
              color: Colors.grey
          )

      ),
      // 文本框的样式.
      inputDecorationTheme: InputDecorationTheme(
        border: OutlineInputBorder (
            borderRadius: BorderRadius.circular(15.0),
            borderSide:BorderSide(color: AppColors.editFieldborder_color)
        ),
        focusedBorder: OutlineInputBorder (
            borderRadius: BorderRadius.circular(15.0),
            borderSide:BorderSide(color: AppColors.editFieldborder_color)
        ),
        enabledBorder: OutlineInputBorder (
            borderRadius: BorderRadius.circular(15.0),
            borderSide:BorderSide(color: AppColors.editFieldborder_color)
        ),
        hintStyle: TextStyle(color: AppColors.editFieldText_color,fontSize: 30.sp),
        helperStyle: TextStyle(color: AppColors.editFieldText_color,fontSize: 30.sp),
        labelStyle: TextStyle(color: AppColors.editFieldText_color,fontSize: 30.sp),
        contentPadding: EdgeInsets.all(10.0),
      ),
      //
      elevatedButtonTheme: ElevatedButtonThemeData(
          style: ButtonStyle(
              backgroundColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
                if (states.contains(WidgetState.pressed)) {
                  return AppColors.app_base_bgcolor_color.withOpacity(0.7); // 按下时的背景色
                }
                if (states.contains(WidgetState.disabled)) {
                  return Colors.grey;
                }
                return AppColors.app_base_bgcolor_color; // 默认背景色
              }),
              foregroundColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
                if (states.contains(WidgetState.disabled)) {
                  return Colors.white;
                }
                return Colors.white;
              }),
              shape: WidgetStateProperty.all<OutlinedBorder>(
                RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(30.0), // 圆角大小
                ),
              ),
              padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
                EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), // 内边距
              ),
              overlayColor: WidgetStateProperty.resolveWith<Color?>(
                    (Set<WidgetState> states) {
                  if (states.contains(WidgetState.hovered)) {
                    return Colors.green.withOpacity(0.1); // 悬停时的叠加色
                  }
                  return null; // 默认无叠加色
                },
              ),
              textStyle: WidgetStateProperty.resolveWith<TextStyle>(
                    (Set<WidgetState> states) {
                  return TextStyle(fontSize: 36.sp,fontWeight: FontWeight.bold);
                },
              )
          )
      ),
      primaryTextTheme: TextTheme(
          titleMedium: TextStyle(fontWeight: FontWeight.w400,fontSize: 40.sp)
      ),
      textTheme: TextTheme(
        titleMedium: TextStyle(fontWeight: FontWeight.w400,fontSize: 40.sp),
        titleSmall: TextStyle(fontWeight: FontWeight.w400,fontSize: 28.sp),
        labelMedium: TextStyle(fontSize: 30.sp,color: AppColors.app_base_bgcolor_color),
        labelSmall: TextStyle( color: AppColors.labelText_color,fontSize: 24.sp),
      ),
      dialogTheme: DialogTheme(
          contentTextStyle: TextStyle(fontSize: 30.sp,fontWeight: FontWeight.bold,color: AppColors.hex1E1E1E)

      ),*/

  );

}